/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.cmc.service.merchant.model.impl;

import com.cmc.service.merchant.model.AgentEntry;
import com.cmc.service.merchant.model.AgentEntryModel;
import com.cmc.service.merchant.model.AgentEntrySoap;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSON;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ProxyUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.util.PortalUtil;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;

import java.io.Serializable;

import java.sql.Types;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * The base model implementation for the AgentEntry service. Represents a row in the &quot;CTI_AgentEntry&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.cmc.service.merchant.model.AgentEntryModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link AgentEntryImpl}.
 * </p>
 *
 * @author ntcuong1
 * @see AgentEntryImpl
 * @see com.cmc.service.merchant.model.AgentEntry
 * @see com.cmc.service.merchant.model.AgentEntryModel
 * @generated
 */
@JSON(strict = true)
public class AgentEntryModelImpl extends BaseModelImpl<AgentEntry>
	implements AgentEntryModel {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this class directly. All methods that expect a agent entry model instance should use the {@link com.cmc.service.merchant.model.AgentEntry} interface instead.
	 */
	public static final String TABLE_NAME = "CTI_AgentEntry";
	public static final Object[][] TABLE_COLUMNS = {
			{ "agentId", Types.BIGINT },
			{ "creatorUserId", Types.BIGINT },
			{ "companyId", Types.BIGINT },
			{ "createDate", Types.TIMESTAMP },
			{ "modifiedDate", Types.TIMESTAMP },
			{ "type_", Types.VARCHAR },
			{ "code_", Types.VARCHAR },
			{ "firstName", Types.VARCHAR },
			{ "middleName", Types.VARCHAR },
			{ "lastName", Types.VARCHAR },
			{ "prefixId", Types.INTEGER },
			{ "suffixId", Types.INTEGER },
			{ "male", Types.BOOLEAN },
			{ "birthdayMonth", Types.INTEGER },
			{ "birthdayYear", Types.INTEGER },
			{ "birthdayDay", Types.INTEGER },
			{ "jobTitle", Types.VARCHAR },
			{ "email", Types.VARCHAR },
			{ "merchantId", Types.BIGINT },
			{ "loginable", Types.BOOLEAN },
			{ "userId", Types.BIGINT },
			{ "screenName", Types.VARCHAR }
		};
	public static final String TABLE_SQL_CREATE = "create table CTI_AgentEntry (agentId LONG not null primary key,creatorUserId LONG,companyId LONG,createDate DATE null,modifiedDate DATE null,type_ VARCHAR(75) null,code_ VARCHAR(75) null,firstName VARCHAR(75) null,middleName VARCHAR(75) null,lastName VARCHAR(75) null,prefixId INTEGER,suffixId INTEGER,male BOOLEAN,birthdayMonth INTEGER,birthdayYear INTEGER,birthdayDay INTEGER,jobTitle VARCHAR(75) null,email VARCHAR(75) null,merchantId LONG,loginable BOOLEAN,userId LONG,screenName VARCHAR(75) null)";
	public static final String TABLE_SQL_DROP = "drop table CTI_AgentEntry";
	public static final String ORDER_BY_JPQL = " ORDER BY agentEntry.code ASC, agentEntry.firstName ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CTI_AgentEntry.code_ ASC, CTI_AgentEntry.firstName ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.cmc.service.merchant.model.AgentEntry"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.cmc.service.merchant.model.AgentEntry"),
			true);
	public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.column.bitmask.enabled.com.cmc.service.merchant.model.AgentEntry"),
			true);
	public static long CODE_COLUMN_BITMASK = 1L;
	public static long MERCHANTID_COLUMN_BITMASK = 2L;
	public static long TYPE_COLUMN_BITMASK = 4L;

	/**
	 * Converts the soap model instance into a normal model instance.
	 *
	 * @param soapModel the soap model instance to convert
	 * @return the normal model instance
	 */
	public static AgentEntry toModel(AgentEntrySoap soapModel) {
		if (soapModel == null) {
			return null;
		}

		AgentEntry model = new AgentEntryImpl();

		model.setAgentId(soapModel.getAgentId());
		model.setCreatorUserId(soapModel.getCreatorUserId());
		model.setCompanyId(soapModel.getCompanyId());
		model.setCreateDate(soapModel.getCreateDate());
		model.setModifiedDate(soapModel.getModifiedDate());
		model.setType(soapModel.getType());
		model.setCode(soapModel.getCode());
		model.setFirstName(soapModel.getFirstName());
		model.setMiddleName(soapModel.getMiddleName());
		model.setLastName(soapModel.getLastName());
		model.setPrefixId(soapModel.getPrefixId());
		model.setSuffixId(soapModel.getSuffixId());
		model.setMale(soapModel.getMale());
		model.setBirthdayMonth(soapModel.getBirthdayMonth());
		model.setBirthdayYear(soapModel.getBirthdayYear());
		model.setBirthdayDay(soapModel.getBirthdayDay());
		model.setJobTitle(soapModel.getJobTitle());
		model.setEmail(soapModel.getEmail());
		model.setMerchantId(soapModel.getMerchantId());
		model.setLoginable(soapModel.getLoginable());
		model.setUserId(soapModel.getUserId());
		model.setScreenName(soapModel.getScreenName());

		return model;
	}

	/**
	 * Converts the soap model instances into normal model instances.
	 *
	 * @param soapModels the soap model instances to convert
	 * @return the normal model instances
	 */
	public static List<AgentEntry> toModels(AgentEntrySoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<AgentEntry> models = new ArrayList<AgentEntry>(soapModels.length);

		for (AgentEntrySoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}

	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.cmc.service.merchant.model.AgentEntry"));

	public AgentEntryModelImpl() {
	}

	public long getPrimaryKey() {
		return _agentId;
	}

	public void setPrimaryKey(long primaryKey) {
		setAgentId(primaryKey);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_agentId);
	}

	public void setPrimaryKeyObj(Serializable primaryKeyObj) {
		setPrimaryKey(((Long)primaryKeyObj).longValue());
	}

	public Class<?> getModelClass() {
		return AgentEntry.class;
	}

	public String getModelClassName() {
		return AgentEntry.class.getName();
	}

	@Override
	public Map<String, Object> getModelAttributes() {
		Map<String, Object> attributes = new HashMap<String, Object>();

		attributes.put("agentId", getAgentId());
		attributes.put("creatorUserId", getCreatorUserId());
		attributes.put("companyId", getCompanyId());
		attributes.put("createDate", getCreateDate());
		attributes.put("modifiedDate", getModifiedDate());
		attributes.put("type", getType());
		attributes.put("code", getCode());
		attributes.put("firstName", getFirstName());
		attributes.put("middleName", getMiddleName());
		attributes.put("lastName", getLastName());
		attributes.put("prefixId", getPrefixId());
		attributes.put("suffixId", getSuffixId());
		attributes.put("male", getMale());
		attributes.put("birthdayMonth", getBirthdayMonth());
		attributes.put("birthdayYear", getBirthdayYear());
		attributes.put("birthdayDay", getBirthdayDay());
		attributes.put("jobTitle", getJobTitle());
		attributes.put("email", getEmail());
		attributes.put("merchantId", getMerchantId());
		attributes.put("loginable", getLoginable());
		attributes.put("userId", getUserId());
		attributes.put("screenName", getScreenName());

		return attributes;
	}

	@Override
	public void setModelAttributes(Map<String, Object> attributes) {
		Long agentId = (Long)attributes.get("agentId");

		if (agentId != null) {
			setAgentId(agentId);
		}

		Long creatorUserId = (Long)attributes.get("creatorUserId");

		if (creatorUserId != null) {
			setCreatorUserId(creatorUserId);
		}

		Long companyId = (Long)attributes.get("companyId");

		if (companyId != null) {
			setCompanyId(companyId);
		}

		Date createDate = (Date)attributes.get("createDate");

		if (createDate != null) {
			setCreateDate(createDate);
		}

		Date modifiedDate = (Date)attributes.get("modifiedDate");

		if (modifiedDate != null) {
			setModifiedDate(modifiedDate);
		}

		String type = (String)attributes.get("type");

		if (type != null) {
			setType(type);
		}

		String code = (String)attributes.get("code");

		if (code != null) {
			setCode(code);
		}

		String firstName = (String)attributes.get("firstName");

		if (firstName != null) {
			setFirstName(firstName);
		}

		String middleName = (String)attributes.get("middleName");

		if (middleName != null) {
			setMiddleName(middleName);
		}

		String lastName = (String)attributes.get("lastName");

		if (lastName != null) {
			setLastName(lastName);
		}

		Integer prefixId = (Integer)attributes.get("prefixId");

		if (prefixId != null) {
			setPrefixId(prefixId);
		}

		Integer suffixId = (Integer)attributes.get("suffixId");

		if (suffixId != null) {
			setSuffixId(suffixId);
		}

		Boolean male = (Boolean)attributes.get("male");

		if (male != null) {
			setMale(male);
		}

		Integer birthdayMonth = (Integer)attributes.get("birthdayMonth");

		if (birthdayMonth != null) {
			setBirthdayMonth(birthdayMonth);
		}

		Integer birthdayYear = (Integer)attributes.get("birthdayYear");

		if (birthdayYear != null) {
			setBirthdayYear(birthdayYear);
		}

		Integer birthdayDay = (Integer)attributes.get("birthdayDay");

		if (birthdayDay != null) {
			setBirthdayDay(birthdayDay);
		}

		String jobTitle = (String)attributes.get("jobTitle");

		if (jobTitle != null) {
			setJobTitle(jobTitle);
		}

		String email = (String)attributes.get("email");

		if (email != null) {
			setEmail(email);
		}

		Long merchantId = (Long)attributes.get("merchantId");

		if (merchantId != null) {
			setMerchantId(merchantId);
		}

		Boolean loginable = (Boolean)attributes.get("loginable");

		if (loginable != null) {
			setLoginable(loginable);
		}

		Long userId = (Long)attributes.get("userId");

		if (userId != null) {
			setUserId(userId);
		}

		String screenName = (String)attributes.get("screenName");

		if (screenName != null) {
			setScreenName(screenName);
		}
	}

	@JSON
	public long getAgentId() {
		return _agentId;
	}

	public void setAgentId(long agentId) {
		_agentId = agentId;
	}

	@JSON
	public long getCreatorUserId() {
		return _creatorUserId;
	}

	public void setCreatorUserId(long creatorUserId) {
		_creatorUserId = creatorUserId;
	}

	public String getCreatorUserUuid() throws SystemException {
		return PortalUtil.getUserValue(getCreatorUserId(), "uuid",
			_creatorUserUuid);
	}

	public void setCreatorUserUuid(String creatorUserUuid) {
		_creatorUserUuid = creatorUserUuid;
	}

	@JSON
	public long getCompanyId() {
		return _companyId;
	}

	public void setCompanyId(long companyId) {
		_companyId = companyId;
	}

	@JSON
	public Date getCreateDate() {
		return _createDate;
	}

	public void setCreateDate(Date createDate) {
		_createDate = createDate;
	}

	@JSON
	public Date getModifiedDate() {
		return _modifiedDate;
	}

	public void setModifiedDate(Date modifiedDate) {
		_modifiedDate = modifiedDate;
	}

	@JSON
	public String getType() {
		if (_type == null) {
			return StringPool.BLANK;
		}
		else {
			return _type;
		}
	}

	public void setType(String type) {
		_columnBitmask |= TYPE_COLUMN_BITMASK;

		if (_originalType == null) {
			_originalType = _type;
		}

		_type = type;
	}

	public String getOriginalType() {
		return GetterUtil.getString(_originalType);
	}

	@JSON
	public String getCode() {
		if (_code == null) {
			return StringPool.BLANK;
		}
		else {
			return _code;
		}
	}

	public void setCode(String code) {
		_columnBitmask = -1L;

		if (_originalCode == null) {
			_originalCode = _code;
		}

		_code = code;
	}

	public String getOriginalCode() {
		return GetterUtil.getString(_originalCode);
	}

	@JSON
	public String getFirstName() {
		if (_firstName == null) {
			return StringPool.BLANK;
		}
		else {
			return _firstName;
		}
	}

	public void setFirstName(String firstName) {
		_columnBitmask = -1L;

		_firstName = firstName;
	}

	@JSON
	public String getMiddleName() {
		if (_middleName == null) {
			return StringPool.BLANK;
		}
		else {
			return _middleName;
		}
	}

	public void setMiddleName(String middleName) {
		_middleName = middleName;
	}

	@JSON
	public String getLastName() {
		if (_lastName == null) {
			return StringPool.BLANK;
		}
		else {
			return _lastName;
		}
	}

	public void setLastName(String lastName) {
		_lastName = lastName;
	}

	@JSON
	public int getPrefixId() {
		return _prefixId;
	}

	public void setPrefixId(int prefixId) {
		_prefixId = prefixId;
	}

	@JSON
	public int getSuffixId() {
		return _suffixId;
	}

	public void setSuffixId(int suffixId) {
		_suffixId = suffixId;
	}

	@JSON
	public boolean getMale() {
		return _male;
	}

	public boolean isMale() {
		return _male;
	}

	public void setMale(boolean male) {
		_male = male;
	}

	@JSON
	public int getBirthdayMonth() {
		return _birthdayMonth;
	}

	public void setBirthdayMonth(int birthdayMonth) {
		_birthdayMonth = birthdayMonth;
	}

	@JSON
	public int getBirthdayYear() {
		return _birthdayYear;
	}

	public void setBirthdayYear(int birthdayYear) {
		_birthdayYear = birthdayYear;
	}

	@JSON
	public int getBirthdayDay() {
		return _birthdayDay;
	}

	public void setBirthdayDay(int birthdayDay) {
		_birthdayDay = birthdayDay;
	}

	@JSON
	public String getJobTitle() {
		if (_jobTitle == null) {
			return StringPool.BLANK;
		}
		else {
			return _jobTitle;
		}
	}

	public void setJobTitle(String jobTitle) {
		_jobTitle = jobTitle;
	}

	@JSON
	public String getEmail() {
		if (_email == null) {
			return StringPool.BLANK;
		}
		else {
			return _email;
		}
	}

	public void setEmail(String email) {
		_email = email;
	}

	@JSON
	public long getMerchantId() {
		return _merchantId;
	}

	public void setMerchantId(long merchantId) {
		_columnBitmask |= MERCHANTID_COLUMN_BITMASK;

		if (!_setOriginalMerchantId) {
			_setOriginalMerchantId = true;

			_originalMerchantId = _merchantId;
		}

		_merchantId = merchantId;
	}

	public long getOriginalMerchantId() {
		return _originalMerchantId;
	}

	@JSON
	public boolean getLoginable() {
		return _loginable;
	}

	public boolean isLoginable() {
		return _loginable;
	}

	public void setLoginable(boolean loginable) {
		_loginable = loginable;
	}

	@JSON
	public long getUserId() {
		return _userId;
	}

	public void setUserId(long userId) {
		_userId = userId;
	}

	public String getUserUuid() throws SystemException {
		return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
	}

	public void setUserUuid(String userUuid) {
		_userUuid = userUuid;
	}

	@JSON
	public String getScreenName() {
		if (_screenName == null) {
			return StringPool.BLANK;
		}
		else {
			return _screenName;
		}
	}

	public void setScreenName(String screenName) {
		_screenName = screenName;
	}

	public long getColumnBitmask() {
		return _columnBitmask;
	}

	@Override
	public ExpandoBridge getExpandoBridge() {
		return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
			AgentEntry.class.getName(), getPrimaryKey());
	}

	@Override
	public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
		ExpandoBridge expandoBridge = getExpandoBridge();

		expandoBridge.setAttributes(serviceContext);
	}

	@Override
	public AgentEntry toEscapedModel() {
		if (_escapedModelProxy == null) {
			_escapedModelProxy = (AgentEntry)ProxyUtil.newProxyInstance(_classLoader,
					_escapedModelProxyInterfaces,
					new AutoEscapeBeanHandler(this));
		}

		return _escapedModelProxy;
	}

	@Override
	public Object clone() {
		AgentEntryImpl agentEntryImpl = new AgentEntryImpl();

		agentEntryImpl.setAgentId(getAgentId());
		agentEntryImpl.setCreatorUserId(getCreatorUserId());
		agentEntryImpl.setCompanyId(getCompanyId());
		agentEntryImpl.setCreateDate(getCreateDate());
		agentEntryImpl.setModifiedDate(getModifiedDate());
		agentEntryImpl.setType(getType());
		agentEntryImpl.setCode(getCode());
		agentEntryImpl.setFirstName(getFirstName());
		agentEntryImpl.setMiddleName(getMiddleName());
		agentEntryImpl.setLastName(getLastName());
		agentEntryImpl.setPrefixId(getPrefixId());
		agentEntryImpl.setSuffixId(getSuffixId());
		agentEntryImpl.setMale(getMale());
		agentEntryImpl.setBirthdayMonth(getBirthdayMonth());
		agentEntryImpl.setBirthdayYear(getBirthdayYear());
		agentEntryImpl.setBirthdayDay(getBirthdayDay());
		agentEntryImpl.setJobTitle(getJobTitle());
		agentEntryImpl.setEmail(getEmail());
		agentEntryImpl.setMerchantId(getMerchantId());
		agentEntryImpl.setLoginable(getLoginable());
		agentEntryImpl.setUserId(getUserId());
		agentEntryImpl.setScreenName(getScreenName());

		agentEntryImpl.resetOriginalValues();

		return agentEntryImpl;
	}

	public int compareTo(AgentEntry agentEntry) {
		int value = 0;

		value = getCode().compareTo(agentEntry.getCode());

		if (value != 0) {
			return value;
		}

		value = getFirstName().compareTo(agentEntry.getFirstName());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		AgentEntry agentEntry = null;

		try {
			agentEntry = (AgentEntry)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long primaryKey = agentEntry.getPrimaryKey();

		if (getPrimaryKey() == primaryKey) {
			return true;
		}
		else {
			return false;
		}
	}

	@Override
	public int hashCode() {
		return (int)getPrimaryKey();
	}

	@Override
	public void resetOriginalValues() {
		AgentEntryModelImpl agentEntryModelImpl = this;

		agentEntryModelImpl._originalType = agentEntryModelImpl._type;

		agentEntryModelImpl._originalCode = agentEntryModelImpl._code;

		agentEntryModelImpl._originalMerchantId = agentEntryModelImpl._merchantId;

		agentEntryModelImpl._setOriginalMerchantId = false;

		agentEntryModelImpl._columnBitmask = 0;
	}

	@Override
	public CacheModel<AgentEntry> toCacheModel() {
		AgentEntryCacheModel agentEntryCacheModel = new AgentEntryCacheModel();

		agentEntryCacheModel.agentId = getAgentId();

		agentEntryCacheModel.creatorUserId = getCreatorUserId();

		agentEntryCacheModel.companyId = getCompanyId();

		Date createDate = getCreateDate();

		if (createDate != null) {
			agentEntryCacheModel.createDate = createDate.getTime();
		}
		else {
			agentEntryCacheModel.createDate = Long.MIN_VALUE;
		}

		Date modifiedDate = getModifiedDate();

		if (modifiedDate != null) {
			agentEntryCacheModel.modifiedDate = modifiedDate.getTime();
		}
		else {
			agentEntryCacheModel.modifiedDate = Long.MIN_VALUE;
		}

		agentEntryCacheModel.type = getType();

		String type = agentEntryCacheModel.type;

		if ((type != null) && (type.length() == 0)) {
			agentEntryCacheModel.type = null;
		}

		agentEntryCacheModel.code = getCode();

		String code = agentEntryCacheModel.code;

		if ((code != null) && (code.length() == 0)) {
			agentEntryCacheModel.code = null;
		}

		agentEntryCacheModel.firstName = getFirstName();

		String firstName = agentEntryCacheModel.firstName;

		if ((firstName != null) && (firstName.length() == 0)) {
			agentEntryCacheModel.firstName = null;
		}

		agentEntryCacheModel.middleName = getMiddleName();

		String middleName = agentEntryCacheModel.middleName;

		if ((middleName != null) && (middleName.length() == 0)) {
			agentEntryCacheModel.middleName = null;
		}

		agentEntryCacheModel.lastName = getLastName();

		String lastName = agentEntryCacheModel.lastName;

		if ((lastName != null) && (lastName.length() == 0)) {
			agentEntryCacheModel.lastName = null;
		}

		agentEntryCacheModel.prefixId = getPrefixId();

		agentEntryCacheModel.suffixId = getSuffixId();

		agentEntryCacheModel.male = getMale();

		agentEntryCacheModel.birthdayMonth = getBirthdayMonth();

		agentEntryCacheModel.birthdayYear = getBirthdayYear();

		agentEntryCacheModel.birthdayDay = getBirthdayDay();

		agentEntryCacheModel.jobTitle = getJobTitle();

		String jobTitle = agentEntryCacheModel.jobTitle;

		if ((jobTitle != null) && (jobTitle.length() == 0)) {
			agentEntryCacheModel.jobTitle = null;
		}

		agentEntryCacheModel.email = getEmail();

		String email = agentEntryCacheModel.email;

		if ((email != null) && (email.length() == 0)) {
			agentEntryCacheModel.email = null;
		}

		agentEntryCacheModel.merchantId = getMerchantId();

		agentEntryCacheModel.loginable = getLoginable();

		agentEntryCacheModel.userId = getUserId();

		agentEntryCacheModel.screenName = getScreenName();

		String screenName = agentEntryCacheModel.screenName;

		if ((screenName != null) && (screenName.length() == 0)) {
			agentEntryCacheModel.screenName = null;
		}

		return agentEntryCacheModel;
	}

	@Override
	public String toString() {
		StringBundler sb = new StringBundler(45);

		sb.append("{agentId=");
		sb.append(getAgentId());
		sb.append(", creatorUserId=");
		sb.append(getCreatorUserId());
		sb.append(", companyId=");
		sb.append(getCompanyId());
		sb.append(", createDate=");
		sb.append(getCreateDate());
		sb.append(", modifiedDate=");
		sb.append(getModifiedDate());
		sb.append(", type=");
		sb.append(getType());
		sb.append(", code=");
		sb.append(getCode());
		sb.append(", firstName=");
		sb.append(getFirstName());
		sb.append(", middleName=");
		sb.append(getMiddleName());
		sb.append(", lastName=");
		sb.append(getLastName());
		sb.append(", prefixId=");
		sb.append(getPrefixId());
		sb.append(", suffixId=");
		sb.append(getSuffixId());
		sb.append(", male=");
		sb.append(getMale());
		sb.append(", birthdayMonth=");
		sb.append(getBirthdayMonth());
		sb.append(", birthdayYear=");
		sb.append(getBirthdayYear());
		sb.append(", birthdayDay=");
		sb.append(getBirthdayDay());
		sb.append(", jobTitle=");
		sb.append(getJobTitle());
		sb.append(", email=");
		sb.append(getEmail());
		sb.append(", merchantId=");
		sb.append(getMerchantId());
		sb.append(", loginable=");
		sb.append(getLoginable());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", screenName=");
		sb.append(getScreenName());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(70);

		sb.append("<model><model-name>");
		sb.append("com.cmc.service.merchant.model.AgentEntry");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>agentId</column-name><column-value><![CDATA[");
		sb.append(getAgentId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>creatorUserId</column-name><column-value><![CDATA[");
		sb.append(getCreatorUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>companyId</column-name><column-value><![CDATA[");
		sb.append(getCompanyId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>createDate</column-name><column-value><![CDATA[");
		sb.append(getCreateDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
		sb.append(getModifiedDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>type</column-name><column-value><![CDATA[");
		sb.append(getType());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>code</column-name><column-value><![CDATA[");
		sb.append(getCode());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>firstName</column-name><column-value><![CDATA[");
		sb.append(getFirstName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>middleName</column-name><column-value><![CDATA[");
		sb.append(getMiddleName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>lastName</column-name><column-value><![CDATA[");
		sb.append(getLastName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>prefixId</column-name><column-value><![CDATA[");
		sb.append(getPrefixId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>suffixId</column-name><column-value><![CDATA[");
		sb.append(getSuffixId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>male</column-name><column-value><![CDATA[");
		sb.append(getMale());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>birthdayMonth</column-name><column-value><![CDATA[");
		sb.append(getBirthdayMonth());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>birthdayYear</column-name><column-value><![CDATA[");
		sb.append(getBirthdayYear());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>birthdayDay</column-name><column-value><![CDATA[");
		sb.append(getBirthdayDay());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>jobTitle</column-name><column-value><![CDATA[");
		sb.append(getJobTitle());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>email</column-name><column-value><![CDATA[");
		sb.append(getEmail());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>merchantId</column-name><column-value><![CDATA[");
		sb.append(getMerchantId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>loginable</column-name><column-value><![CDATA[");
		sb.append(getLoginable());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>screenName</column-name><column-value><![CDATA[");
		sb.append(getScreenName());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private static ClassLoader _classLoader = AgentEntry.class.getClassLoader();
	private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
			AgentEntry.class
		};
	private long _agentId;
	private long _creatorUserId;
	private String _creatorUserUuid;
	private long _companyId;
	private Date _createDate;
	private Date _modifiedDate;
	private String _type;
	private String _originalType;
	private String _code;
	private String _originalCode;
	private String _firstName;
	private String _middleName;
	private String _lastName;
	private int _prefixId;
	private int _suffixId;
	private boolean _male;
	private int _birthdayMonth;
	private int _birthdayYear;
	private int _birthdayDay;
	private String _jobTitle;
	private String _email;
	private long _merchantId;
	private long _originalMerchantId;
	private boolean _setOriginalMerchantId;
	private boolean _loginable;
	private long _userId;
	private String _userUuid;
	private String _screenName;
	private long _columnBitmask;
	private AgentEntry _escapedModelProxy;
}